package yangsw87.basic;

import java.util.Scanner;

public class J17_PerformanceMain {
	
	private static String title = "공연 예약 프로그램";
	private static String menu = "예약<1>, 조회<2>, 취소<3>, 끝내기<4>>>";
	private static String addmsg = "이름, 좌석번호순으로 입력";		
	private static String exitmsg ="프로그램을 종료합니다!";
	private static String seatmsg = "좌석구분 S<1>, A<2>, B<3>>>";

	public static void main(String[] args) {
		
		J17_Performance psrv = new J17_Performance();
		Scanner sc = new Scanner(System.in);

		System.out.println(title);
		while(true){
			System.out.println(menu);
			switch(sc.nextInt()){
			case 1: System.out.println(seatmsg);
				switch (sc.nextInt()){
				case 1: addPerformance(sc,psrv);
				}
						
		
			break;
			case 2: showPerformance(psrv);
			break;
			case 3: 
			case 4:
				sc.close();
				System.out.println(exitmsg);
				System.exit(0);
				break;
			
			}
			
		}
		
	}

	private static void showPerformance(J17_Performance psrv) {
		System.out.println(psrv.readPerformance());
		
	}

	private static void addPerformance(Scanner sc, J17_Performance psrv) {
		System.out.println(addmsg);
		
		J17_PerformanceVO pfvo = new J17_PerformanceVO(sc.next(), sc.nextInt());
		psrv.addPerformance(pfvo);
	}
	
	

}
